<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" ></meta>
    <title>质控数据</title>
    <link rel="stylesheet" href="${frames}/css/lib/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="${frames}/css/lib/bootstrap-datetimepicker.min.css" type="text/css">
    <link rel="stylesheet" href="${frames}/css/lib/dataTables.bootstrap.css">
    <link rel="stylesheet" href="${frames}/css/paginate.css" type="text/css">
    <link rel="stylesheet" href="${newframe}/css/base/base.css">
    <link rel="stylesheet" href="${frames}/css/record.css" type="text/css">
    <link rel="stylesheet" href="${frames}/css/picker.css" type="text/css">
    <script src="${newframe}/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="${newframe}/js/respond.js" type="text/javascript"></script>
    <script type="text/javascript" src="${frames}/js/lib/bootstrap.min.js"></script>
    <script src="${frames}/js/lib/metisMenu.js"></script>
    <script src="${frames}/js/lib/jquery.dataTables.js" type="text/javascript"></script>
    <script src="${frames}/js/lib/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript" src="${frames}/js/lib/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="${frames}/js/lib/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script src="${frames}/js/lib/jquery.dataTables.js" type="text/javascript"></script>
    <script src="${newframe}/base/base.js"></script>
    <script src="${newframe}/js/modalOption.js"></script>
   	<script>
	   	function editKB(id){
	   		window.showModelIframe("${URL_QULITITY_TOKB}?id="+id,"KB值修改",800,400);
	   	}
	   	function addKB(){
	   		var machineId = $("#machineId").val();
	   		window.showModelIframe("${URL_QULITITY_TOADDKB}?id="+machineId,"KB值新增",800,400);
	   	}
   	</script>
</head>
<body>
<div id="recordwrap">
    <div class="page-header">
        <!-- /.page-header -->
        <ul class="page_nav">
            <li class="first cur">医卫士云平台&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;</li>
            <li class="cur">数据查询&nbsp;&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;</li>
            <li>质控数据</li>
        </ul>
    </div>
    <h3 style='font: normal 14px/70px "微软雅黑";color: #566278;'>质控数据</h3>
    <div class="form">
    	<input type="hidden" id=machineId value="${machineId}" />
        <label>质控项目:</label>
        <input id="quanName" type="text" class="SN" placeholder="质控项目">
        <label>项目批号:</label>
        <input id="projectBatch" type="text" class="address" placeholder="项目批号">
        <input id="query" type="button" value="搜索" class="search" onclick="refreshTable();">
        <span class="clear" onclick="cleanFormUnHidden()">清除条件</span>
    </div>
    <div class="tableRecord">
        <table id="recordList" class="display" cellspacing="10" width="100%">
            <thead>
            <tr>
                <th>质控项目</th>
                <th>项目批号</th>
                <th>质控通道</th>
                <th>质控时间</th>
                <th>质控批号</th>
                <th>质控结果</th>
                <th>高值，低值</th>
                <th>靶值</th>
                <th>SD</th>
            </tr>
            </thead>
        </table>
    </div>
</div>
<div class="modal fade" id="myModalIframe" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times; </button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body">
            </div>
        </div>
    </div>
</div>
<script>
var table;
function initTable() {
   table = $('#recordList').DataTable({
	    "dom": "<'row'<'col-xs-2'l><'#mytool.col-xs-10'><'col-xs-6'f>r>" +
       "t" +
       "<'row'<'col-sm-6'i><'col-sm-6'p>>", 
   		"bFilter": false,//去掉搜索框
       "bAutoWidth": true, //自适应宽度
       "sPaginationType" : "full_numbers",
       "ordering": false,//是否允许Datatables开启排序
       "bProcessing" : true,
       "bServerSide" : true,
       "sAjaxSource":"${URL_QULITITY_QUADATA}",
       "sAjaxDataProp": "dataList",//查询后，返回的集合
       "fnServerData": function ( sSource, aoData, fnCallback ) {  //查询条件
           aoData.push(
                   { "name": "machineId", "value": $("#machineId").val() },
                   { "name": "quanName", "value": $("#quanName").val() },
                   { "name": "projectBatch", "value": $("#projectBatch").val() }
           );
           $.ajax( {
             "dataType": 'json',
             "url": sSource,
             "type":'post',
             "data": aoData,
             "success": fnCallback
           } );

        },
       
       "aoColumns" : [{
           "mDataProp" : "quanName"
         }, {
       	 "mDataProp" : "projectBatch"
         }, {
       	 "mDataProp" : "quaCh"
         }, {
           "mDataProp" : "quaDateTime",
           "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
               var time = "";
               if(sData!=null){
              	 time = sData.year+"-"+sData.monthOfYear+"-"+coverZero(sData.dayOfMonth)
                   +" "+coverZero(sData.hourOfDay)+":"+coverZero(sData.minuteOfHour)+":"+coverZero(sData.secondOfMinute);
               }
               $(nTd).html(time);
             }
         }, {
           "mDataProp" : "quaBatch"
         }, {
             "mDataProp" : "quaResult"
         }, {
             "mDataProp" : "quaHL"
         }, {
             "mDataProp" : "quaValue"
         }, {
             "mDataProp" : "quaSD"
         }],
       "createdRow": function ( row, data, index ) {
           $('td', row).eq(0).addClass('border_left');
           $('td', row).eq(5).addClass('border_right');

       },
       "oLanguage": {//插件的汉化
           "sLengthMenu": "每页显示 _MENU_ 条记录",
           "sZeroRecords": "抱歉， 没有找到",
           "sInfo": "当前显示 _START_ 到 _END_条 ,共 _TOTAL_ 条记录",
           "sInfoEmpty": "没有数据",
           "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
           "oPaginate": {
               "sFirst": "首页",
               "sPrevious": "上一页",
               "sNext": "下一页",
               "sLast": "末页"
           },
           "sZeroRecords": "没有检索到数据",
           "sProcessing": "<img src='' />",
           "sSearch": "搜索"
       }, 
       "lengthChange":false,
       "lengthMenu": [5],
        "initComplete": function() {
           /* $("#mytool").append('<button id="update_butt" type="button" class="btn btn-outline btn-success" onclick="updateKB()" style="float:right;;margin-right:10px;background: #35c990;border:none;">修改</button>'); */
           /* $("#mytool").append('<button id="add_butt" type="button" class="btn btn-outline btn-success" onclick="addKB()" style="float:right;;margin-right:10px;background: #35c990;border:none;">新增</button>'); */
       }
   } );
 }
$(document).ready(function() {
    initTable();
    $('#recordList_info').parent().addClass('showPage'); 
	$('#recordList_previous').parent().addClass('pageNow');
});
</script>
</body>
</html>